package com.wbl.tijiancms.controller;

import com.wbl.tijiancms.pojo.Orders;
import com.wbl.tijiancms.response.ApiRestResponse;
import com.wbl.tijiancms.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/order")
@RestController
public class OrdersController {

    @Autowired
    OrdersService ordersService;


    @ResponseBody
    @PutMapping("/confirmOrder")
    public ApiRestResponse ConfirmOrder(@RequestBody Orders order){
        return ordersService.ConfirmOrder(order);
    }

    @ResponseBody
    @PostMapping("/orderlist")
    public ApiRestResponse getOrderlistforuser(@RequestBody Orders order){
        return ordersService.getOrderlistforuser(order);
    }
    @ResponseBody
    @PutMapping("/editOrder")
    public ApiRestResponse editOrder(@RequestBody Orders order){
        return ordersService.editOrder(order);
    }

    @ResponseBody
    @PostMapping("/orderAll")
    public ApiRestResponse getOrderAll(@RequestBody Orders orders){
        return ordersService.getOrderAll(orders);
    }

    @ResponseBody
    @PostMapping("/orderdetail")
    public ApiRestResponse getOrderById(@RequestBody Orders order){
        return ordersService.getOrderById(order);
    }
}
